package edu.bbk.muc.lifetracker.sensormanager;

import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.util.Log;

/**
 * This is an abstract sensor event listener. It does intersept all events, but
 * doesn't do much with them. It is duty of its children to overload one or
 * several methods and do something sensible with them.
 * @author irenatyler and romankirillov
 */
public class AbstractSensorListener implements SensorEventListener {
  private static final String TAG = "AbstractSensorListener";

  @Override
  public void onAccuracyChanged(Sensor arg0, int arg1) {
    Log.d(TAG, "onAccuracyChanged: " + arg0.getName() + " -> " + arg1);
  }

  @Override
  public void onSensorChanged(SensorEvent arg0) {
    Log.d(TAG,
        "onSensorChanged: " +
            arg0.sensor.getName() +
            " -> " +
            String.format("%f %f %f", arg0.values));
  }
}
